package com.example.test_witns.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;

public class TemperatureHumidity {
    private Long id;
    private Double temperature;
    private Double humidity;
    private String recordedAt;

    public Double getTemperature() {
        return temperature;
    }

    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }

    public Double getHumidity() {
        return humidity;
    }

    public void setHumidity(Double humidity) {
        this.humidity = humidity;
    }

    public String getRecordedAt() {
        return recordedAt;
    }

    public void setRecordedAt(String recordedAt) {
        this.recordedAt = recordedAt;
    }

    public TemperatureHumidity(Long id, Double temperature, Double humidity, String recordedAt) {
        this.id = id;
        this.temperature = temperature;
        this.humidity = humidity;
        this.recordedAt = recordedAt;
    }

    @Override
    public String toString() {
        return "TemperatureHumidityResponse{" +
                "msg='" + id + '\'' +
                ", status=" + temperature +
                ", data=" + humidity +
                '}';
    }

    public static class Data {
        private int id;
        private double temperature;
        private double humidity;
        private String recordedAt;

        @Override
        public String toString() {
            return "Data{" +
                    "id=" + id +
                    ", temperature=" + temperature +
                    ", humidity=" + humidity +
                    ", recordedAt='" + recordedAt + '\'' +
                    '}';
        }
    }

    @JsonIgnore
    public TemperatureHumidity getTemperatureHumidity(){
        return this;
    }
}